-# <%# locals: (notice:, problem:) -%>
.window
  %table.summary
    %tr
      %th= t('.message')
      %td.main.nowrap= message_graph(problem)
    %tr
      %th= t('.error_class')
      %td= notice.error_class
    - if notice.request['url'].present?
      %tr
        %th= t('.url')
        %td.nowrap= link_to notice.request['url'], notice.request['url']
    %tr
      %th= t('.where')
      %td= notice.where
    %tr
      %th= t('.occurred')
      %td= notice.created_at.to_fs(:precise)
    %tr
      %th= t('.similar')
      %td= problem.notices_count - 1
    %tr#sparkline-placeholder
    %tr
      %th= t('.browser')
      %td= user_agent_graph(problem)
    %tr
      %th= t('.tenant')
      %td= tenant_graph(problem)
    - if notice.server_environment && notice.server_environment["hostname"]
      %tr
        %th= t('.app_server')
        %td= notice.server_environment && notice.server_environment["hostname"]
    - if notice.app_version.present?
      %tr
        %th= t('.app_version')
        %td= notice.app_version
    - if notice.framework
      %tr
        %th= t('.framework')
        %td= notice.framework
    %tr
      %th= t('.relative_directory')
      %td= notice.server_environment && notice.server_environment["project-root"]

:javascript
  $.ajax({url: '/apps/#{notice.app.id}/problems/#{problem.id}/xhr_sparkline'}).then(function(resp) {
    $("#sparkline-placeholder").replaceWith(resp);
  });
